package com.uye.framework.dto;

import com.uye.framework.util.StringUtils;

/**
 * Bean representing the basic response to be returned to the client
 * application. All responses must have the name of the original service
 * requested.
 * 
 * @author uye
 * 
 */
public abstract class BaseJSONResponse implements IJSONResponse {

	private static final String SUCCESS_STATUS_CODE = "200";
	
	/**
	 * Original service call.
	 */
	private String originServiceName;

	/**
	 * Force implementing classes to always provide the name of the service call
	 * so the client will know as to why its getting a response.
	 * @param originServiceName The original service call
	 */
	public BaseJSONResponse(final String originServiceName) {
		this.originServiceName = originServiceName;
	}
	public void setOriginServiceName(final String originServiceName) {
		
		this.originServiceName = originServiceName;
	}

	public String getOriginServiceName() {
		return originServiceName;
	}

	public String getStatusCode() {
		return SUCCESS_STATUS_CODE;
	}

	public String toString() {
		return StringUtils.toJSONString(this);
	}
}
